<template>
    <div>
        <v-dialog v-model="showDialog" persistent max-width="500px">
            <v-card>
                <v-card-title class="headline">{{ title }}</v-card-title>
                <v-card-text>
                    {{ text }}
                </v-card-text>
                <v-card-actions>
                    <v-btn color="primary" text @click="ok">确定</v-btn>
                    <v-btn color="info" text @click="$emit('cancal')">取消</v-btn>
                </v-card-actions>
            </v-card>
        </v-dialog>
    </div>
</template>
<script>
export default {
    props: {
        show: Boolean,
        title: String,
        text: String,
        ok: Function
    },
    data() {
        return {
            showDialog: false
        }
    },
    watch: {
        show(newVal, oldVal) {
            this.showDialog = newVal
        }
    }
}
</script>